<?php
class Model_Helperapos_Scodelog extends Zend_Db_Table_Abstract  {

	protected $_name = 'dbo.SCODE_LOG';
	protected $_adaptor = 'db_helperapos';
	protected $_primary = 'ID_LOG';
	
	
	public function getIntrDate($sCode){
		$whereStr = "SCODE LIKE '{$sCode}'";
		$row = $this->fetchRow($whereStr);
		if(!$row) return false;
		
		return $row['DATE_INSERT'];
	}
	
	public function getLastWeekUpdate($dateBegin,$dateEnd){
		
		$whereStr = "DATE_INSERT >= '{$dateBegin}' AND DATE_INSERT <= '{$dateEnd}'";
		$rows = $this->fetchAll($whereStr,"SCODE");
		if(empty($rows)) return false;
		
		return $rows->toArray();
	}	
}
?>